#!/bin/sh

set -eux

: ${CMAKE_PARAMS:=}

mkdir -p "build"
cd "build"
cmake \
    -D CMAKE_BUILD_TYPE=Release \
    -D DEPS=DOWNLOAD \
    -D ENABLE_TESTING=OFF \
    ${CMAKE_PARAMS} \
    ..
cmake --build .
DESTDIR=$(pwd)/../install cmake --install . --strip

cd ..
find install -name 'ccache*' -type f -exec mv '{}' install ';'
find install -ls
